function extend2(Child ,Parent){
	var p = Parent.prototype;
	var c = Child.prototype;
	for (var i in p){
		c[i] = p[i];
	}
	c.uber = p;
}
function extend (Child ,Parent){
    var F = function (){};
    F.prototype =Parent.prototype;
    Child.prototype= new F();
    Child.prototype.constructor=Child;
    Child.uber =Parent.prototype;
}
function Shape() {
}
Shape.prototype.name =	this.name = 'Shape';
Shape.prototype.toString = function () {
    var result = [];
    if (this.constructor.uber){
        result[result.length]=this.constructor.uber.toString();
    }
    result[result.length]= this.name;
    return result.join(',');
};

function TwoDShape(){}
extend(TwoDShape,Shape)
var td = new TwoDShape();
console.log("td.name");
console.log(td.name);
console.log("TwoDShape.prototype.name");
console.log(TwoDShape.prototype.name);
console.log("td.__proto__.name");
console.log(td.__proto__.name);
console.log("td.hasOwnProperty('name')");
console.log(td.hasOwnProperty('name'));
console.log("td.__proto__.hasOwnProperty('name')");
console.log(td.__proto__.hasOwnProperty('name'));

function TwoDShape(){}
extend2(TwoDShape,Shape)
TwoDShape.prototype.name ="2d shape"1200
var td2 = new TwoDShape();
console.log("td2.__proto__.hasOwnProperty('name')");
console.log(td2.__proto__.hasOwnProperty('name'));
console.log("td2.__proto__.hasOwnProperty('toString')");
console.log(td2.__proto__.hasOwnProperty('toString'));
console.log("td2.__proto__.toString === Shape.prototype.toString");
console.log(td2.__proto__.toString === Shape.prototype.toString);
